package com.ccys.doctor.controller;

import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.dto.doctor.completedOrEndCall.CompleteBookingDto;
import com.ccys.db.dto.doctor.completedOrEndCall.CompleteOfflineBookingDto;
import com.ccys.db.dto.doctor.completedOrEndCall.EndCallDto;
import com.ccys.doctor.service.CompletedOrEndCallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @program: WhiteCoat
 * @description: Completed or End Call
 * @author: ZhangJingCan
 * @create: 2024-03-04 11:58
 **/

@Slf4j
@RestController
@RequestMapping("/completedOrEndCall")
@Api(tags = "CompletedOrEndCall")
public class CompletedOrEndCallController {

    @Autowired
    private CompletedOrEndCallService completedOrEndCallService;

    @ApiOperation("完成预定")
    @GetMapping(value = "/CompleteBooking")
    public ResponseResultApp completeBooking(CompleteBookingDto dto) {
        return completedOrEndCallService.completeBooking(dto);
    }

    @ApiOperation("完成离线预订")
    @GetMapping(value = "/CompleteOfflineBooking")
    public ResponseResultApp completeOfflineBooking(CompleteOfflineBookingDto dto) {
        return completedOrEndCallService.completeOfflineBooking(dto);
    }

    @ApiOperation("完成TBTC预订")
    @GetMapping(value = "/CompleteTBTCBooking")
    public ResponseResultApp completeTBTCBooking(CompleteOfflineBookingDto dto) {
        return completedOrEndCallService.completeTBTCBooking(dto);
    }

    @ApiOperation("结束通话")
    @GetMapping(value = "/EndCall")
    public ResponseResultApp endCall(EndCallDto dto) {
        return completedOrEndCallService.endCall(dto);
    }

    @ApiOperation("EndCallOfflineBooking")//结束线下问诊通话
    @GetMapping(value = "/EndCallOfflineBooking")
    public ResponseResultApp endCallOfflineBooking(EndCallDto dto) throws ParseException {
        return completedOrEndCallService.endCallOfflineBooking(dto);
    }

}
